package eval.deploy;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import eval.host.Host;
import eval.vm.VirtualMachine;

/**
 * Generates and stores the history of deploys in the cloud infrastructure
 * 
 * @author Nicola Calcavecchia <calcavecchia@elet.polimi.it>
 * */
public interface IDeployManager extends Serializable {

	/**
	 * Returns the set of VMs to be deployed at cycle <code>cycle</code>
	 * */
	public DeploySet getDeploySetAtTick(int tick);

	/**
	 * Returns a list containing all the Virtual Machines that need to be
	 * removed at the given cycle
	 * */
	public List<VirtualMachine> getVMToBeRemovedAtTick(int tick, Map<Host, List<VirtualMachine>> vmMapping);
	public List<VirtualMachine> getVMToBeRemovedAtTick(int cycle,List<VirtualMachine> vmList);
	/**
	 * true <==> the is removed at the given cycle, false otherwise
	 * */
	public boolean isVMRemovedAtTick(VirtualMachine virtualMachine, int tick);
	
	/**
	 * Adds the given deploy set at the given tick
	 * */
	public void setDeploySetAtTick(DeploySet ds, int tick);

	/**
	 * Returns the number of ticks from which the VM is alive
	 */
	public int getVMLifetime(VirtualMachine vm, int tick);
//
//	/**
//	 * Returns true if the VMs is removed in the last monitoring instants
//	 * */
//	public boolean vmIsRemovedInPastInterval(VirtualMachine virtualMachine,int tick);
	
	/**
	 * Set the cycle when the virtual machine was deploy
	 * @param vm The virtual machine to deploy
	 * @param cycle The experiment tick
	 */
	public void setVmStartLife(VirtualMachine vm,int cycle);

	
	
}
